package agent.simple.premain;

import java.lang.instrument.Instrumentation;

/**
 * appdemo.AppBootstrap
 *
 * @author cyril
 * @date 2022/3/8 10:03 下午
 * <p>
 * 日进一寸 日拱一卒
 */
public class MyAgent {

    public static void premain(String agentArgs) {
        System.out.println("premain start");
        System.out.println("args:" + agentArgs);

        // java -javaagent:${agentPath} -jar app-demo-1.0-SNAPSHOT.jar
        // java -javaagent:../../simple-premain-agent/target/simple-premain-agent-1.0-SNAPSHOT.jar -jar app-demo-1.0-SNAPSHOT.jar
        // java -javaagent:../../simple-premain-agent/target/simple-premain-agent-1.0-SNAPSHOT.jar='hello world' -jar app-demo-1.0-SNAPSHOT.jar
        // java -javaagent:../../simple-premain-agent/target/simple-premain-agent-1.0-SNAPSHOT.jar='hello world' -javaagent:../../simple-premain-agent/target/simple-premain-agent-1.0-SNAPSHOT.jar='hello agent' -jar app-demo-1.0-SNAPSHOT.jar
    }

    public static void agentmain(String agentArgs, Instrumentation instrumentation) {

    }

    }
